import React, { Component } from 'react'
import { HashRouter, Route } from 'react-router-dom'

import Home from './view/Home'
import Category from './view/Category'
import Cart from './view/Cart'
import My from './view/My'
import Tabbar from './view/TabbarNav'
import SearchPage from './view/SearchPage'
import GoodList from './view/GoodList'
import GoodDdetail from './view/GoodDdetail'


export default class RouterConfig extends Component {
  render() {
    return (
      <HashRouter>
        <Route exact path="/" render={() => <Tabbar><Home></Home></Tabbar>}></Route>
        <Route exact path="/category" render={() => <Tabbar><Category></Category></Tabbar>}></Route>
        <Route exact path="/cart" render={() => <Tabbar><Cart></Cart></Tabbar>}></Route>
        <Route exact path="/my" render={() => <Tabbar><My></My></Tabbar>}></Route>
        <Route exact path="/searchPage" render={(props) => <SearchPage {...props}></SearchPage>}></Route>
        <Route exact path="/goodList/:id" render={(props) => <GoodList {...props}></GoodList>}></Route>
        <Route exact path="/goodDdetail/:id" render={(props) => <GoodDdetail {...props}></GoodDdetail>}></Route>

      </HashRouter>
    )
  }
}
